<?php

declare(strict_types=1);

namespace App\AdminApi\Modular\User\Controller;

use App\AdminApi\BasicsController;
use App\AdminApi\Modular\User\Service\{
    LevelService, TagsService
};
use App\Common\Extend\Guard\Auth;
use Core\HyperfUnit\Response;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\GetMapping;
use Psr\Http\Message\ResponseInterface;

#[
    Controller(prefix: '/admin-api/filter-panel', server: self::SERVER),
    Auth(guard: self::GUARD, sign: 'skip', app: self::APP)
]
class FilterPanelController extends BasicsController
{


    #[
        GetMapping('user-level'),
        Auth(label: ['会员等级'], logger: false)
    ]
    public function UserLevel(LevelService $service): ResponseInterface
    {
        return Response::Api()->success(data: $service->dictionary());
    }


    #[
        GetMapping('user-tags'),
        Auth(label: ['会员标签'], logger: false)
    ]
    public function UserTags(TagsService $service): ResponseInterface
    {
        return Response::Api()->success(data: $service->dictionary());
    }
}
